const { GenerateDtsPlugin } = require('@masons/generate-types')
const env = process.env.NODE_ENV

function isProd() {
  return env === 'production'
}
module.exports = {
  devServer: {
    port: 8080,
    hot: true,
    headers: {
      "Access-Control-Allow-Origin": "*",
      "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
      "Access-Control-Allow-Headers":
        "X-Requested-With, content-type, Authorization",
    },
  },
  publicPath: isProd() ? './' : '/',
  productionSourceMap: false,
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: []
    }
  },
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          modifyVars: {
            'primary-color': '#2a55e5',
          },
          javascriptEnabled: true
        }
      }
    }
  },
}
